﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TCCHWLib.Commands
{
    public class DivCommand:ICommand
    {
             
        public DivCommand(object parameter1,ParameterType parameterType1,object parameter2,ParameterType paramterType2)
        {
            m_Operand1 = parameter1;
            m_Operand2 = parameter2;
            m_Type1 = parameterType1;
            m_Type2 = paramterType2;
            m_ExOperand1 = parameter1;
            m_ExOperand2 = parameter2;
            m_ExType1 = parameterType1;
            m_ExType2 = paramterType2;
            this.Value = 0 ;
        }
        public override object Execute(Processor processor)
        {
            double op1 = Convert.ToDouble(m_ExOperand1);
            double op2 = Convert.ToDouble(m_ExOperand2);
            m_Value = op1 / op2;
            return this.Value;
        }
        public override string ToString()
        {
            return base.ToString() + String.Format("> {0}, {1} , = >> {2}", m_Operand1,m_Operand2, this.Value);
        }

    }
}
